<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>{$title}</title>
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->


    <!-- Le styles -->
    <link href="/public/css/icons.css" rel="stylesheet">
    <link href="/public/bootstrap.css" rel="stylesheet">
    <link href='http://fonts.googleapis.com/css?family=Ubuntu+Mono' rel='stylesheet' type='text/css'>
    <style type="text/css">
        body {
        padding-top: 60px;
        }
    </style>
{foreach from=$styles item=stylesheet}
    <link href="{$stylesheet}" rel="stylesheet">
{/foreach}


</head>

<body>

<div class="topbar">
    <div class="fill">
        <div class="container">
            <a style="margin-left:0;" class="brand" href="/">Nieuwsbuis!</a>
            <ul class="nav">
                <li id="button-list-item-category"><a class="brand" id="category" href="#">Categoriën</a></li>
                <li id="button-list-item-channel"><a class="brand" id="channel" href="#">Kanalen</a></li>
                <form class="navbar-search" action="/search" method="post">
                    <input type="text" name="searchField" class="search-query span2" placeholder="Zoek"><i class="icon-search icon-white" style="cursor: pointer; margin-left: 5px;" onclick="parentNode.submit()"></i>
                </form>
            </ul>
        {if $this->session->userdata('loggedin')}
            <span class="pull-right">
                <ul class="nav">
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle brand" data-toggle="dropdown">Account<span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="/user/view/{$authenticated_user->getUsername()}"><i class="icon-user icon-white"></i>{$authenticated_user->getName()}</a></li>
                            <li><a href="/post/create"><i class="icon-pencil icon-white"></i>Plaats bericht</a></li>
                            <li class="divider"></li>
                            <li><a href="/auth/logout"><i class="icon-off icon-white"></i>Log uit</a></li>
                        </ul>
                    </li>
                </ul>
            </span>
            {else}

            <span class=pull-right>
                <ul class="nav">
                    <li><a href="/auth/login" class="brand">Log in</a></li>
                    <li><a href="/auth/register" class="brand">Registreer</a></li>
                </ul>
            </span>
        {/if}

        </div>

        <div class="container">
            <div id="category-list">
                {if $this->session->userdata('loggedin')}
                    {if sizeof($myCategories) != 0}<h2>Mijn Categorie:</h2>{/if}
                    {foreach from=$myCategories item=category}
                        <a href="/category/{$category->getName()}" class="header-preview brand">[{substr(strtolower($category->getName()), 0, 15)}]</a>
                    {/foreach}
                    <div class="clearme"></div>
                {/if}
                <h2>Alles:</h2>
                {foreach from=$headerCategories item=category}
                    <a href="/category/{$category}" class="header-preview brand">[{substr(strtolower($category), 0, 15)}]</a>
                {/foreach}
                <div class="clearme"></div>
            </div>
            <div id="channel-list">
                {if $this->session->userdata('loggedin')}
                    {if sizeof($myChannels) != 0}<h2>Mijn Kanalen:</h2>{/if}
                    {foreach from=$myChannels item=channel}
                        <a href="/channel/view/{str_replace(',', '_', str_replace(' ', '-', $channel->getName()))}" class="header-preview brand">[{substr(strtolower($channel->getName()), 0, 15)}]</a>
                    {/foreach}
                {/if}
                <div class="clearme"></div>

                <h2>Allernieuwste:</h2>
                    {foreach from=$headerChannels item=channel}
                        <a href="/channel/view/{str_replace(',', '_', str_replace(' ', '-', $channel->getName()))}" class="header-preview brand">[{substr(strtolower($channel->getName()), 0, 15)}]</a>
                    {/foreach}
                <div class="clearme"></div>
                <h2>Opties:</h2>
                <a href="/channel/create" class="header-preview brand">[nieuw kanaal aanmaken]</a>
                <div class="clearme"></div>

            </div>
        </div>
    </div>


</div>






